<style>
    #template{
        width: 695px;
        position: relative;
        font-family: arial;
    }

    #div-left   {
        width: 600px;
    }

    .article-block{
        padding-top: 30px;
        padding-left: 29px;
        padding-right: 29px;
        padding-bottom: 23px;
    }

    .article-action{
        background-color: #F9F9F9;
        border-bottom: solid 1px #999999;
        padding: 2px;
        text-align: right;
        cursor: move;
    }
    .link-edit,
    .link-delete    {
        font-size: 12px;
        color: #65a3c2 !important;
        cursor: pointer;
    }
    .link-edit:hover,
    .link-delete:hover    {
        color: #6c6c6c !important;
        cursor: pointer;
    }

    .article-title{
        font-size: 24px;
        color: #E4212D;
        background-color: white;
        padding: 0px;
        margin: 0px;
        margin-bottom: 22px;
    }

    .article-resume{
        background-color: white;
        font-size: 12px;
        color: #727678;
        padding: 0px;
        margin: 0px;
    }

    .newsletter-image-container img{
        margin-right: 22px;
        margin-bottom: 10px;
        border: 2px solid #737779;
        float: left;
    }


    .article-more-details{
        border-top: 1px solid #E5E5E5;
        border-bottom: 1px solid #E5E5E5;

        padding-top: 6px;
        padding-left: 5px;
        padding-bottom: 7px;
        margin: 0px;
    }

    .article-more-details a{
        color:#727678 !important;
        font-size: 12px;
    }

    .article-more-details a:hover{
        color:#E4212D !important;
    }

    #template div.zone_panel    {
        padding: 2px !important;
        padding-bottom:30px !important;
    }

    #clone{
        display: none;
    }

    #zone_1 li  {
        /*width: 450px;*/
        background-color: white;
        cursor: move;
    }

    .td-template-header {
        background-color:white;
        border:solid 2px #C5DEEB;
        padding: 10px 0px 10px 5px;

    }


    #releaseTitle{
        font-size: 18px;
        color:#E4202C;
        border-top: 1px solid #BBC2C4;
        border-bottom: 1px solid #BBC2C4;
        text-align: right;
        margin-top: 14px;
        padding-top: 8px;
        padding-bottom: 8px;
        padding-right: 28px;
        text-transform: uppercase;
    }

</style>

<div id="page-block-zones">
    <div id="template">

        <table width="600px">

        <!-- Image Entête -->
        <tr>
            <td class="td-template-header12" colspan="2">

                <div id='releaseTitle'><?php echo($this->newsletter['NR_Title']); ?></div>
            </td>
        </tr>

        <!-- Newsletter Content -->
        <tr valign="top">
            <!-- Left Column -->
            <td valign="top" width="450px">
                <div id="div-left-newsletter" class="zone_panel zone_1_panel">
                    <ul id="zone_1" class="zone connectedSortable">
                        <li id="clone">
                            <div class="block_action_icon article-action">
                                <a class="link-edit" href="#">Éditer</a>
                                <a class="link-delete last" href="#">Supprimer</a>
                            </div>
                            <div class="article-title article-title-left"></div>
                            <div class="article-resume article-resume-left"></div>
                            <div class="article-more-details-left">Plus de détails</div>
                        </li>
                        <?php
                        foreach ($this->articles as $article)
                        {
                            if($article['NA_ZoneID'] == 1)
                            {
                            ?>
                                <li id="article-<?php echo($article['NA_ID']); ?>" articleID="<?php echo($article['NA_ID']); ?>" class="ui-state-default" zoneid="1" positionID="<?php echo($article['NA_PositionID']); ?>" releaseID="<?php echo($article['NA_ReleaseID']); ?>">
                                    <div class="block_action_icon article-action">
                                        <a class="link-edit" href="<?php echo $this->url(array('controller'=>'article','action'=>'edit', 'articleID'=>$article['NA_ID'])); ?>">Éditer</a>
                                        <a class="link-delete last" href="<?php echo $this->url(array('controller'=>'article','action'=>'delete', 'articleID'=>$article['NA_ID'])); ?>">Supprimer</a>
                                    </div>
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-left:29px;padding-right:29px;padding-top:30px;padding-bottom:23px;border-bottom:1px solid #BBC2C4;font-size: 12px;color: #727678;">
                                        <tr>
                                            <td width="100%" style="font-size: 24px;color: #E4212D;background-color: white;padding-bottom: 22px;">
                                                <?php echo($article['NA_Title']); ?>
                                            </td>
                                        </tr>
                                        <tr>
                                            <?php if(!empty($article['NA_ImageSrc'])): ?>
                                                <?php $config = Zend_Registry::get('config')->toArray(); ?>
                                                <?php $thumbMaxHeight = $config['newsletter']['image']['thumb']['maxHeight']; ?>
                                                <?php $thumbMaxWidth  = $config['newsletter']['image']['thumb']['maxWidth']; ?>

                                                <td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
                                                    <td valign="top" style="padding-right:22px;width:<?php echo($thumbMaxWidth); ?>px">
                                                        <img style="border:2px solid #737779;" src="<?php echo Zend_Registry::get('www_root') ?>/data/images/newsletter/<?php echo($this->newsletter['NR_ID']); ?>/<?php echo($article['NA_ID']); ?>/<?php echo(str_replace($article['NA_ImageSrc'],$thumbMaxWidth.'x'.$thumbMaxHeight.'_'.$article['NA_ImageSrc'],$article['NA_ImageSrc'])); ?>" alt="<?php echo($article['NA_ImageAlt']); ?>"/>
                                                    </td>
                                                    <td valign="top"><table border="0" cellpadding="0" cellspacing="0" style="height:<?php echo($thumbMaxHeight); ?>px;">
                                                        <tr>
                                                            <td valign="top" style="height:<?php echo($thumbMaxHeight-30); ?>px;font-size: 12px;color: #727678;">
                                                                <?php $text = Cible_FunctionsGeneral::html2text($article['NA_Resume']); ?>
                                                                <?php $text = Cible_FunctionsGeneral::truncateString($text,array(), 200); ?>
                                                                <?php echo($text); ?>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td valign="bottom" style="font-size: 12px;color: #727678;">
                                                                <?php if($article['NA_Text']): ?>
                                                                    <div style= "border-top: 1px solid #E5E5E5;border-bottom: 1px solid #E5E5E5;padding-top: 6px;padding-left: 5px;padding-bottom: 7px;margin: 0px; vertical-align:bottom;">Plus de détails</div>
                                                                <?php endif; ?>
                                                            </td>
                                                        </tr>
                                                        </table>
                                                    </td>
                                                </tr></table></td>
                                            <?php else: ?>
                                                <td style="font-size: 12px;color: #727678;">
                                                    <?php $text = Cible_FunctionsGeneral::html2text($article['NA_Resume']); ?>
                                                    <?php $text = Cible_FunctionsGeneral::truncateString($text,array(), 200); ?>
                                                    <?php echo($text); ?>
                                                    <?php if($article['NA_Text']): ?>
                                                        <div style="border-top: 1px solid #E5E5E5;border-bottom: 1px solid #E5E5E5;padding-top: 6px;padding-left: 5px;padding-bottom: 7px;margin: 0px;">Plus de détails</div>
                                                    <?php endif; ?>
                                                </td>
                                            <?php endif; ?>
                                        </tr>
                                    </table>
                                </li>
                            <?php
                            }
                        }
                        ?>
                    </ul>
                </div>
            </td>
            <!-- Right Column -->
            <td valign="top" width="150px" rowspan="2">
                <div id="div-right-newsletter" class="zone_panel zone_2_panel">
                    <ul id="zone_2" class="zone connectedSortable">
                        <li id="clone">
                            <div class="block_action_icon article-action">
                                <a class="link-edit" href="#">Éditer</a>
                                <a class="link-delete last" href="#">Supprimer</a>
                            </div>
                            <div class="article-title article-title-left"></div>
                            <div class="article-resume article-resume-left"></div>
                            <div class="article-more-details-left">Plus de détails</div>
                        </li>
                        <?php
                        foreach ($this->articles as $article)
                        {
                            if($article['NA_ZoneID'] == 2)
                            {
                            ?>
                                <li id="article-<?php echo($article['NA_ID']); ?>" articleID="<?php echo($article['NA_ID']); ?>" class="ui-state-default" zoneid="1" positionID="<?php echo($article['NA_PositionID']); ?>" releaseID="<?php echo($article['NA_ReleaseID']); ?>">
                                    <div class="block_action_icon article-action">
                                        <a class="link-edit" href="<?php echo $this->url(array('controller'=>'article','action'=>'edit', 'articleID'=>$article['NA_ID'])); ?>">Éditer</a>
                                        <a class="link-delete last" href="<?php echo $this->url(array('controller'=>'article','action'=>'delete', 'articleID'=>$article['NA_ID'])); ?>">Supprimer</a>
                                    </div>
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-left:29px;padding-right:29px;padding-top:30px;padding-bottom:23px;border-bottom:1px solid #BBC2C4;font-size: 12px;color: #727678;">
                                        <tr>
                                            <td width="100%" style="font-size: 24px;color: #E4212D;background-color: white;padding-bottom: 22px;">
                                                <?php echo($article['NA_Title']); ?>
                                            </td>
                                        </tr>
                                        <tr>
                                           
                                        <td style="font-size: 12px;color: #727678;">
                                            <?php $text = Cible_FunctionsGeneral::html2text($article['NA_Resume']); ?>
                                            <?php $text = Cible_FunctionsGeneral::truncateString($text,array(), 200); ?>
                                            <?php echo($text); ?>

                                             <?php if($article['NA_Text']): ?>
                                                <div style="border-top: 1px solid #E5E5E5;border-bottom: 1px solid #E5E5E5;padding-top: 6px;padding-left: 5px;padding-bottom: 7px;margin: 0px;">Plus de détails</div>
                                            <?php endif; ?>
                                        </td>
                                            
                                        </tr>
                                    </table>
                                </li>
                            <?php
                            }
                        }
                        ?>
                    </ul>
                </div>
            </td>
        </tr>
        </table>
    </div>
</div>